<?php
//Zend_Loader::loadFile('../application/admin/models/Template.php');
class Menu
{
    /**
     * @var object Zend DB Adapter
     */
    private $_db;
    /**
     * @var string
     */
   
    public function __construct()
    {
			$this->_db = Zend_Registry::get('db');
    }
    
    public function listMenuItems()
    {
    	$getMenuItems = $this->_db->fetchAll("
			SELECT menu_id, title, url, parent_id, has_child, status 
			FROM menu			
		");
		
		return $getMenuItems;
	}
	
	public function getParentItems()
	{
		$getMenuItems = $this->_db->fetchAll("
			SELECT menu_id, title, has_child
			FROM menu
			WHERE parent_id = 0 AND status = 1
		");
		
		return $getMenuItems;
	}
}